package com.hue.springcloud.controller;

import com.hue.springcloud.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

@RestController
public class AccountController {
    @Autowired
    private AccountService accountService;

    @GetMapping("/account/update/{userId}/{num}")
    public void updateAccount(@PathVariable("userId")long userId, @PathVariable("num")BigDecimal num){
        System.out.println(userId+","+num);
        accountService.updateAccount(userId,num);
        System.out.println("账户修改完成");
    }
}
